/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package plar.Properties;

/**
 *
 * @author spok
 */
import java.util.HashMap;
import plar.*;
        
public class CollisionDetect extends Property{

   public CollisionDetect()
    {
     super("collisiondetect");
    }
    public boolean doElementsProperty(Element e1,Element e2)
    {
         boolean collision=false;
   
              if(e1!=e2 && e2.getPosition().intersects(e1.getPosition()))
              {
                  
                  collision = collision || e2.doAction("collision", new Event(e1));
                  collision = collision || e1.doAction("collision", new Event(e2));
              }

          return collision;
    }
}
